-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Implement third-party Permissions module #16414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
[dotnet] Implement third-party Permissions module #16414
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No value,. In any case thank you.
dotnet/src/webdriver/BiDi/Extensions/Permissions/PermissionDescriptor.cs
Outdated
Show resolved
Hide resolved
| return bidi; | ||
| } | ||
|
|
||
| public static PermissionsModule AsPermissions(this BiDi bidi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely should be in another class. The reason is we are CLS compatible (I don't still understand why, but anyway), meaning some languages cannot deal with extension methods. They will use static method: WebDriverExtensions.AsPermissions(bidi). But it is not extension of WebDriver.
We should introduce good name for static class, and its namespace.
BiDiExtensions.AsPermissions(bidi)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When Bluetooth module comes to under umbrella, then what? Should we have single static class for all them, or they define own static class in theirs namespace?
I vote for "everything in their namespace". It would be good pattern to demonstrate good practices how to develop module. Separate namespace is not a problem, IDE is still able to suggest extension method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extension methods do not affect CLS compliance. Users can call WebDriverExtensions.AsPermissions(bidi) even on extension methods.
But I agree that extensions should be in separate files. I will make those changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern is about naming: WebDriverExtensions.AsPermissions(bidi) - it is not extension for WebDriver, it is for BiDi.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the two suggestions: WebDriverExtensions -> BiDiExtensions, and permissions in its own area
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add all extension methods in one BiDiExtensions class under root BiDi namespace. And a developer wants to create his own extension under BiDi namespace. Is it criminal? Does he break end-users? I am thinking over naming conflicts. (UPD: I mean class with the same FQN but in different assemblies)
Personally I vote for # 2, but let's analyze impact. # 1 is very straightforward, even if end-user imports namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some libraries that wrap/extend Selenium that use the OpenQA.Selenium namespace segment, so it’s not a marginal concern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My final confidence: # 1 - 65%, # 2 - 35%;
Please think and share your confidence (don't cheat).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me: # 1 - 75%, # 2 - 25%
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YevgeniyShunevych please just vote blindly.
…eneral BiDi extensinos
User description
🔗 Related Issues
Fixes #15329
New API surface:
PR Type
Enhancement
Description
Enable external BiDi module creation and extension
Refactor module architecture with InternalModule base class
Expose Broker and JsonOptions for external access
Simplify module creation with public static method
Diagram Walkthrough
File Walkthrough
13 files
Expose internal properties and refactor module creationAdd new base class for internal modulesRefactor to support external module creationChange inheritance to InternalModuleChange inheritance to InternalModuleChange inheritance to InternalModuleChange inheritance to InternalModuleChange inheritance to InternalModuleChange inheritance to InternalModuleChange inheritance to InternalModuleChange inheritance to InternalModuleChange inheritance to InternalModuleChange inheritance to InternalModule